<template>
  <div id="tinymce">
    <div class="menu-left-table">
      <div class="add-content">
        <tinymce-editor id="edit"
                        ref="tinymce"
                        :content="content"
                        @input='changeTxt'
                        @on-ready="readyEdit"
                        @on-upload-complete="onEditorUploadComplete" />
      </div>
    </div>
  </div>
</template>

<script>
import GlobalMixin from '@/mixins/global'
import tinymceEditor from '@/components/tinymceEditor' // 编辑器
export default {
  name: 'tinymce',
  mixins: [GlobalMixin],
  components: { tinymceEditor },
  data () {
    return {
      content: ''
    }
  },
  beforeMount () {
  },
  mounted () {
  },
  methods: {
    // 上传图片
    onEditorUploadComplete (res) {
      if (res.flag) {
        this.$message.success('上传成功')
      } else {
        this.$message.error('上传失败')
      }
    },
    // 编辑符文板框
    changeTxt (txt) {
    },
    // 编辑器准备完成
    readyEdit () { }
  }
}
</script>
<style lang="less" scoped>
@import "./index.less";
</style>
